package io;

import javax.swing.plaf.basic.BasicTabbedPaneUI;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * 从文件中读取文本数据
 */
public class ReadStringDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("fos.txt");
        int len=fis.available();
        byte[] data=new byte[len];
        fis.read(data);
        String line=new String(data,"UTF-8");
        System.out.println(line);

        fis.close();

    }
}
